<template >
  <el-form :model="forms"   label-width="80px"  style="max-width: 300px">
    <el-form-item label="用户名称">
      <el-input v-model="forms.nickName" />
    </el-form-item>
    <el-form-item label="手机号码">
      <el-input v-model="forms.phonenumber" />
    </el-form-item>
    <el-form-item label="登录账号">
      <el-input v-model="forms.userName" />
    </el-form-item>
    <el-form-item label="密码">
      <el-input v-model="forms.password" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">注册</el-button>
      <el-button>取消</el-button>
    </el-form-item>
  </el-form>

</template>
<script setup lang="ts">


import { register} from "../../api/login.ts";
import type {RegisterData} from "../../api/login.ts"
import {reactive,} from "vue";

const forms = reactive<RegisterData>({
  nickName: null,
  phonenumber: null,
  userName: 'z',
  password: null,

})

const onSubmit = () => {
  console.log(forms)
  register(forms).then((res)=>{
    console.log(res)
  })
}
</script>
<style scoped>

</style>
